#ifndef _DYNAMICARRAY_H_
#define _DYNAMICARRAY_H_
#include <stdbool.h>
#define ElementType void*


typedef struct DynamicArray DArray;
#ifndef __DYNAMICARRAY_H_
#define __DYNAMICARRAY_H_

#define ElementType void*
#include <cstdbool>


class DynamicArray
{
public:
    DynamicArray(void (*ClearPtr)(ElementType)); 
    DynamicArray(const DynamicArray& array);
    ~DynamicArray();
    void InsertTail(ElementType element);
    bool RemoveByIndex(int index);
    bool RemoveByElement(ElementType element, bool (*funcPtr)(ElementType, ElementType),void (*ClearPtr)(ElementType));
    bool RemoveFirstElement(ElementType element, bool (*funcPtr)(ElementType, ElementType), void (*ClearPtr)(ElementType));
    DynamicArray FindElement(ElementType element, bool (*funcPtr)(ElementType, ElementType));
    void Sort(bool (*funcPtr)(ElementType, ElementType));
    void show(void (*printPtr)(ElementType));
private:
    ElementType* dp;
    int len;
    long size;
    void (*ClearPtr)(ElementType);
};

#endif




#endif